package com.ybkj.daijia.server.sales;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ybkj.daijia.server.model.Base;
import java.util.Date;
/**
 * 活动
 *
 * @author Shine
 */

/**
 * 活动
 *
 * @author Shine
 */
public class ActivityManage extends Base {

    public static final int ACTIVITY_STATUS_NOTSTART = 0;
    public static final int ACTIVITY_STATUS_ONUSING = 1;
    public static final int ACTIVITY_STATUS_OVERDUE = 2;
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private String centreActivityImage;//活动中心图片

    private String businessActivityImage;//业务弹窗图片

    private String chainedAddress;//链接地址

    private ServiceType serviceType;//业务类型

    private Long sort;//排序

    private String showLocation;//展示位置

    private Long start;// 开始时间

    private Long end;//结束时间

    private String companyIds;//公司id

    private String companyName;//公司名称

    private Long companyId;//创建者公司id

    private String appKey;


    public String getCompanyIds() {
        return companyIds;
    }

    public void setCompanyIds(String companyIds) {
        this.companyIds = companyIds;
    }

    public Long getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCentreActivityImage() {
        return centreActivityImage;
    }

    public void setCentreActivityImage(String centreActivityImage) {
        this.centreActivityImage = centreActivityImage;
    }

    public String getBusinessActivityImage() {
        return businessActivityImage;
    }

    public void setBusinessActivityImage(String businessActivityImage) {
        this.businessActivityImage = businessActivityImage;
    }

    public Long getStart() {
        return start;
    }

    public void setStart(Long start) {
        this.start = start;
    }

    @JsonIgnore
    public Date getStartDate() {
        return new Date(start);
    }

    public Integer getTimeStatus() {
        if (start > System.currentTimeMillis()) {
            return ACTIVITY_STATUS_NOTSTART;
        } else if (null != end && end < System.currentTimeMillis()) {
            return ACTIVITY_STATUS_OVERDUE;
        } else {
            return ACTIVITY_STATUS_ONUSING;
        }
    }


    public Long getEnd() {
        return end;
    }

    public void setEnd(Long end) {
        this.end = end;
    }

    @JsonIgnore
    public Date getEndDate() {
        if (null == end) {
            return null;
        } else {
            return new Date(end);
        }
    }


    public String getChainedAddress() {
        return chainedAddress;
    }

    public void setChainedAddress(String chainedAddress) {
        this.chainedAddress = chainedAddress;
    }

    public ServiceType getServiceType() {
        return serviceType;
    }

    public void setServiceType(ServiceType serviceType) {
        this.serviceType = serviceType;
    }

    public Long getSort() {
        return sort;
    }

    public void setSort(Long sort) {
        this.sort = sort;
    }


    public String getShowLocation() {
        return showLocation;
    }

    public void setShowLocation(String showLocation) {
        this.showLocation = showLocation;
    }

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }


    public enum ServiceType {
        /**
         * 代驾
         */
        daijia,
        /**
         * 专车
         */
        zhuanche,
        /**
         * 跑腿
         */
        paotui,
        /**
         * 货运
         */
        freight,
        /**
         * 专线
         */
        zhuanxian

    }


}
